#ifndef VIDEOWIDGET_H
#define VIDEOWIDGET_H

#include <QWidget>

class videowidget : public QWidget
{
    Q_OBJECT
public:
    explicit videowidget(QWidget *parent = nullptr);
    ~videowidget();

private:
    int      m_serial;
    int      m_rect_serial;
    QImage*  m_img;
    QRect    m_rect;
    uint8_t* m_buffer;
private:
    void paintEvent(QPaintEvent *event) override;

public:
    void freeImage();

    int serial() const;
    void setSerial(int newSerial);

public slots:
    void showImage(uint8_t* data, int width, int height);
signals:

};

#endif // VIDEOWIDGET_H
